/**
 * 
 */

$( document ).ready(
function () {	
	var string_json = '{{string_json|safe}}';
    var arr_from_json = JSON.parse(string_json);
	
    var data_input = arr_from_json; 
    
    $('#container').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: 'Browser market shares at a specific website, 2010'
        },
        tooltip: {
    	    pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    color: '#000000',
                    connectorColor: '#000000',
                    format: '<b>{point.name}</b>: {point.y}, ({point.percentage:.1f}%)'
                }
            }
        },
        series: [{
            type: 'pie',
            name: 'Browser share',
            data: data_input
        }]
    });
}
);